package com.xit.cloud.controller;

import com.xit.cloud.entity.user;
import com.xit.cloud.mappers.userMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author malguy-wang sir
 * @create ---
 */
@Controller
@RequestMapping("/user")
public class userController {
    @Autowired
    com.xit.cloud.mappers.userMapper userMapper;
    //注册
    @PostMapping("/insert")
    public String insert(String username,String password){
        if(userMapper.insert(new user(username,password,0,null))>0) return "hello";
        else return "error";
    }
    @RequestMapping("/zc")
    public String zc(){
        return "zc";
    }
}

